package com.aaa.sso.controller;

import com.aaa.common.util.Result;
import com.aaa.sso.service.AuthService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ FileName: MemberAuthController
 * @ Description:
 * @ Author:  STB
 * @ CreateTime: 2025/9/8 0008 10:14
 * @ Version: 1.0.0
 */
@RestController
@RequestMapping("memberAuth")
public class MemberAuthController {
    @Resource(name = "memberAuthService")
    private AuthService authService;

    /**
     * 用户登录
     *
     * @param userName
     * @param password
     * @return
     */
    @GetMapping("login")
    public Result login(String userName, String password) {
        return authService.authentication(userName, password);

    }


    /**
     * 校验token
     *
     * @param token
     * @return
     */
    @GetMapping("checkToken")
    public boolean checkToken(@RequestParam("token") String token) {
        return authService.checkToken(token);
    }
}
